package mathtest;

import java.io.IOException;
import java.math.BigDecimal;

public class Main {
	public static void main(String[] a) throws IOException {
		Float a1 = 1.125456f;
		Float b1 = 1.12f;

		BigDecimal a2 = new BigDecimal(a1).setScale(2, BigDecimal.ROUND_HALF_UP);
		System.out.println(a2);
		BigDecimal b2 = new BigDecimal(b1).setScale(2, BigDecimal.ROUND_HALF_UP);
		System.out.println(b2);
		System.out.println(a2.subtract(b2).setScale(1, BigDecimal.ROUND_DOWN).floatValue());
		float x = new BigDecimal(a1 - b1).setScale(2, BigDecimal.ROUND_CEILING).floatValue();

		System.out.println(x);
	}
}
